package com.edu.edumanager.bean;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.util.Date;

public class EduTeacher {
    private Integer id;
    @NotBlank(message = "讲师名称不能为空")
    private String name;

    private Integer sort;

    @Max(value = 2,message = "超过最高级别")
    @Min(value = 1,message = "超过最低级别")
    private Integer level;

    @NotBlank(message = "讲师资历不能为空")
    private String career;

    @NotBlank(message = "讲师简介不能为空")
    private String intro;

    // @NotBlank(message = "讲师头像不能为空")
    private String avatar;

    private Boolean isDeleted;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date gmtCreate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date gmtModified;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career == null ? null : career.trim();
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro == null ? null : intro.trim();
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    @Override
    public String toString() {
        return "EduTeacher{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sort=" + sort +
                ", level=" + level +
                ", career='" + career + '\'' +
                ", intro='" + intro + '\'' +
                ", avatar='" + avatar + '\'' +
                ", isDeleted=" + isDeleted +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                '}';
    }
}